﻿@{
    Layout = "~/Views/Shared/_FormWhite.cshtml";
}

<div class="wrapper animated fadeInRight">
    <form id="form" class="form-horizontal m">
        <div class="form-group">
            <label class="col-sm-2 control-label ">产品名称<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoTitle" col="MotoTitle" type="text" class="form-control" />
            </div>
            <label class="col-sm-2 control-label ">副标题<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoSubtitle" col="MotoSubtitle" type="text" class="form-control" />
            </div>           
        </div>
        <div class="form-group">
          
            <label class="col-sm-2 control-label ">内容<font class="red"> *</font></label>
            <div class="col-sm-10">
                <input id="motoContent" col="MotoContent" type="text" class="form-control" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label ">图片<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="coverImage" col="CoverImage" type="text" class="form-control" />
            </div>
            <label class="col-sm-2 control-label ">备注<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoRemarks" col="MotoRemarks" type="text" class="form-control" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label ">视频Url<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoVideo" col="MotoVideo" type="text" class="form-control" />
            </div>
            <label class="col-sm-2 control-label ">压缩比<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoYsb" col="MotoYsb" type="text" class="form-control" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label ">最大扭矩<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoNiuju" col="MotoNiuju" type="text" class="form-control" />
            </div>
            <label class="col-sm-2 control-label ">离合器<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoLhq" col="MotoLhq" type="text" class="form-control" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label ">终端传动<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoChuandong" col="MotoChuandong" type="text" class="form-control" />
            </div>
            <label class="col-sm-2 control-label ">最高车速<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoShisu" col="MotoShisu" type="text" class="form-control" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label ">长×宽×高<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoCkg" col="MotoCkg" type="text" class="form-control" />
            </div>
            <label class="col-sm-2 control-label ">整备质量<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoZhiliang" col="MotoZhiliang" type="text" class="form-control" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label ">减震方式<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoJianzhen" col="MotoJianzhen" type="text" class="form-control" />
            </div>
            <label class="col-sm-2 control-label ">前制动<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoHzd" col="MotoHzd" type="text" class="form-control" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label ">后轮规格<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoHoulun" col="MotoHoulun" type="text" class="form-control" />
            </div>
            <label class="col-sm-2 control-label ">价格1<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoPrice1" col="MotoPrice1" type="text" class="form-control" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label ">颜色<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoColor" col="MotoColor" type="text" class="form-control" />
            </div>
            <label class="col-sm-2 control-label ">作者<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoAuthor" col="MotoAuthor" type="text" class="form-control" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label ">时间<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoDate" col="MotoDate" type="text" class="form-control" />
            </div>
            <label class="col-sm-2 control-label ">ViewTimes<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="viewTimes" col="ViewTimes" type="text" class="form-control" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label ">CityId<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="cityId" col="CityId" type="text" class="form-control" />
            </div>
            <label class="col-sm-2 control-label ">排放标准<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoT1" col="MotoT1" type="text" class="form-control" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label ">MotoT3<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoT3" col="MotoT3" type="text" class="form-control" />
            </div>

        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label ">MotoTag<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoTag" col="MotoTag" type="text" class="form-control" />
            </div>
            <label class="col-sm-2 control-label ">型式<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoXingshi" col="MotoXingshi" type="text" class="form-control" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label ">上市时间<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoTime" col="MotoTime" type="text" class="form-control" />
            </div>
            <label class="col-sm-2 control-label ">排量<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoPailiang" col="MotoPailiang" type="text" class="form-control" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label ">最大功率<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoGonglv" col="MotoGonglv" type="text" class="form-control" />
            </div>
            <label class="col-sm-2 control-label ">供油方式<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoGongyou" col="MotoGongyou" type="text" class="form-control" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label ">变速型式<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoBiansu" col="MotoBiansu" type="text" class="form-control" />
            </div>
            <label class="col-sm-2 control-label ">启动方式<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoQdfs" col="MotoQdfs" type="text" class="form-control" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label ">加速100km/h<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoJiasu" col="MotoJiasu" type="text" class="form-control" />
            </div>
            <label class="col-sm-2 control-label ">离地间隙<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoLdjx" col="MotoLdjx" type="text" class="form-control" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label ">油箱容量<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoYxrl" col="MotoYxrl" type="text" class="form-control" />
            </div>
            <label class="col-sm-2 control-label ">前制动<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoQzd" col="MotoQzd" type="text" class="form-control" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label ">前轮规格<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoQianlun" col="MotoQianlun" type="text" class="form-control" />
            </div>
            <label class="col-sm-2 control-label ">价格<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoPrice" col="MotoPrice" type="text" class="form-control" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label ">外部链接<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoUrl" col="MotoUrl" type="text" class="form-control" />
            </div>
            <label class="col-sm-2 control-label ">图片集合<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="thumbImage" col="ThumbImage" type="text" class="form-control" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label ">MotoSort<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoSort" col="MotoSort" type="text" class="form-control" />
            </div>
            <label class="col-sm-2 control-label ">类型<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoType" col="MotoType" type="text" class="form-control" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label ">ProvinceId<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="provinceId" col="ProvinceId" type="text" class="form-control" />
            </div>
            <label class="col-sm-2 control-label ">CountyId<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="countyId" col="CountyId" type="text" class="form-control" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label ">MotoT2<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="motoT2" col="MotoT2" type="text" class="form-control" />
            </div>
        </div>
    </form>
</div>

<script type="text/javascript">
    var id = ys.request("id");
    $(function () {
        getForm();

        $('#form').validate({
            rules: {
                motoTitle: { required: true }
            }
        });
    });

    function getForm() {
        if (id > 0) {
            ys.ajax({
                url: '@Url.Content("~/OrganizationManage/Moto/GetFormJson")' + '?id=' + id,
                type: 'get',
                success: function (obj) {
                    if (obj.Tag == 1) {
                        $('#form').setWebControls(obj.Result);
                    }
                }
            });
        }
        else {
            var defaultData = {};
            $('#form').setWebControls(defaultData);
        }
    }

    function saveForm(index) {
        if ($('#form').validate().form()) {
            var postData = $('#form').getWebControls({ Id: id });
            ys.ajax({
                url: '@Url.Content("~/OrganizationManage/Moto/SaveFormJson")',
                type: 'post',
                data: postData,
                success: function (obj) {
                    if (obj.Tag == 1) {
                        ys.msgSuccess(obj.Message);
                        parent.searchGrid();
                        parent.layer.close(index);
                    }
                    else {
                        ys.msgError(obj.Message);
                    }
                }
            });
        }
    }
</script>

